/* eslint-disable react/jsx-pascal-case */

import { ReactNode, useEffect, useRef} from 'react';
import style from './app.module.scss';
import 游戏场景 from './游戏场景'
import 浮层面板 from './浮层面板'
import 注册鼠标事件 from './tools/注册鼠标事件';
// import 注册鼠标事件 from './tools/注册鼠标事件';

interface AppProps{
    children:ReactNode
    
}

const AppUi = (props:AppProps) => {
    const appref:any = useRef('app')
    useEffect(()=>{
        const element:HTMLDivElement = appref.current
        注册鼠标事件(element)
    },[])
    return (
        <div ref={appref} className={style.box} >
            {props.children}
        </div>
    )
}


export default function App(){
    
    return (
        <AppUi >
            <游戏场景/>
            {/* {游戏视窗} */}
            <浮层面板/>
        </AppUi>
    )
}